package com.jie.netty.sender;

import com.jie.netty.message.NoticeInfoMessage;
import com.jie.netty.processor.AbstractMessageProcessor;
import com.jie.netty.processor.NotifyMessageProcessor;
import com.jie.netty.processor.ProcessorFactory;
import com.jie.netty.type.IMCmdType;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.*;

@Service
public class IMSender {

    @Autowired
    private RedisTemplate redisTemplate;

    @Value("${spring.application.name}")
    private String appName;

    public void sendAllNoticeInfo(NoticeInfoMessage message) {
        AbstractMessageProcessor processor = ProcessorFactory.createProcessor(IMCmdType.NOTIFY_MESSAGE);
        processor.process(message);
    }
}
